package com.meeting.meetingroom_api.service;

import com.meeting.meetingroom_api.dto.CancellationDto;
import com.meeting.meetingroom_api.dto.CancellationRequestDto;
import com.meeting.meetingroom_api.entity.Booking;
import com.meeting.meetingroom_api.enums.CancellationStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.math.BigDecimal;

public interface CancellationService {
    // 客户申请取消预订
    CancellationDto requestCancellation(CancellationRequestDto requestDto, Integer customerId);
    
    // 系统自动取消（支付超时等情况）
    CancellationDto systemCancellation(Booking booking, String reason);
    
    // 员工审核取消申请
    CancellationDto reviewCancellation(Integer cancellationId, Integer reviewerId, boolean approved, String rejectionReason);
    
    // 处理退款
    CancellationDto processRefund(Integer cancellationId, String refundTransactionId, BigDecimal actualRefundAmount);
    
    // 获取取消详情
    CancellationDto getCancellationDetails(Integer cancellationId);
    
    // 根据预订ID获取取消详情
    CancellationDto getCancellationDetailsByBookingId(Integer bookingId);
    
    // 获取所有待审核的取消申请
    Page<CancellationDto> getPendingReviews(Pageable pageable);
    
    // 获取指定客户的取消申请
    Page<CancellationDto> getCustomerCancellations(Integer customerId, Pageable pageable);
    
    // 获取指定状态的取消申请
    Page<CancellationDto> getCancellationsByStatus(String status, Pageable pageable);
    
    // 计算预计退款金额和取消费用
    CancellationDto calculateRefundAndFee(Integer bookingId);

    // 客户确认取消完成
    CancellationDto confirmCancellation(Integer cancellationId, Integer customerId);

    // 获取待客户确认的取消申请
    Page<CancellationDto> getPendingCustomerConfirmations(Integer customerId, Pageable pageable);

    // 获取所有待客户确认的取消申请（管理员用）
    Page<CancellationDto> getAllPendingCustomerConfirmations(Pageable pageable);

    CancellationDto resubmitCancellation(Integer customerId, Integer cancellationId, String reason);

    Page<CancellationDto> getCancelByStatus(Integer customerId, CancellationStatus status,Pageable pageable);
}